<?php
namespace app\models;

use yii\base\Model;

/**
 * 出价队列
 * Class UseQueue
 * @package app\models
 */
class UseQueue extends Model
{
    public $isbusy;

    const IS_BUSY = 1;//繁忙
    const NOT_BUSY = 0;//不忙
    //设置到xml
    public static function getConfig()
    {
        $model = new self();
        //促销持续天数
        $baseConfig = simplexml_load_file(__DIR__ .'/../usequeue.xml');
        $model->isbusy = $baseConfig->isbusy;
        return $model;
    }
    //设置到xml
    public function setConfig()
    {
        //促销持续天数
        $baseConfig = simplexml_load_file(__DIR__ .'/../usequeue.xml');
        $baseConfig->isbusy = $this->isbusy;
        $newBaseConfig = $baseConfig->asXML();
        $fp = fopen(__DIR__ .'/../usequeue.xml', "w");
        fwrite($fp, $newBaseConfig);
        fclose($fp);
    }
}
